package com.ruoyi.web.exams.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 选项对象 exam_option
 *
 * @author 范书铭
 * @date 2024-10-02
 */
@ApiModel(value =  "选项",description = "")
@TableName(resultMap = "com.ruoyi.web.exams.mapper.ExamOptionMapper.ExamOptionResult")
@Data
@EqualsAndHashCode(callSuper = true)
public class ExamOption extends BaseEntity implements Comparable<ExamOption> {
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(name = "题目ID",notes = "")
    @Excel(name = "题目ID")
    private Long questionId;
    /** 选项 */
    @ApiModelProperty(name = "选项",notes = "")
    @Excel(name = "选项")
    private String optionTag;

    /** 内容 */
    @ApiModelProperty(name = "内容",notes = "")
    @Excel(name = "内容")
    private String content;

    /** 是否正确答案 */
    @ApiModelProperty(name = "是否正确答案",notes = "")
    @Excel(name = "是否正确答案")
    private Boolean isRight;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("option", getOptionTag())
                .append("content", getContent())
                .append("isRight", getIsRight())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }


    @Override
    public int compareTo(ExamOption o) {
        return this.optionTag .compareTo(o.optionTag);
    }

}